package shared;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class XMLRMIClientRequest {
	
	private InputStream is;
	private OutputStream os;
	private String methodName;
	private List<Object> objectParams;
	
	public XMLRMIClientRequest(InputStream is, OutputStream os){
		this.is = is;
		this.os=os;
		methodName = null;
	}
	
	public void setMethodName(String name){
		this.methodName = name;
	}
	
	public void addParameter(Object o) throws XMLRMIException{
		addParameter(o,null);
	}
	
	public void addParameter(Object o, Class<?> interfaze) throws XMLRMIException{
		objectParams.add(o);
	}
	
	
	public void start() throws XMLRMIException{
		if(methodName == null)
			throw new XMLRMIException("This request has no targed method name");
		
		Document documentRequest = this.toDocument();
	}
	
	public void sendRequest(Document document){
		//TODO
	}
	
	public Document toDocument(){
		
		return null;
	}
	
	public Document receiveResponse(){
		//TODO
		return null;
	}
	
	public void treat(Document documentResponse){
		//TODO
	}
	
	
}
